import 'package:get/get.dart';

class CounterController extends GetxController {
  // var x = 0.obs;
  // var y = 0.obs;
  var x = 0;
  var y = 0;

  void incrementX() => x++;
  void incrementY() {
    y++;
    // 手动更新
    update();
  }

  // int get sum => x.value + y.value;
  int get sum => x + y;
}